package projectMain;

import java.net.MalformedURLException;
import java.nio.file.Path;
import java.nio.file.Paths;

import fileModel.FileManager;

import osListener.OSListener;
import serviceGUI.RemoteControlGUI;
import serviceModle.Service;
import taggingStrategy.TaggingStrategy;

public class Main {
	
	private static RemoteControlGUI remoteGUI;
	private static OSListener osListener;
	private static Service service;
	private static FileManager fileManager;
	

	public static void main(String[] args) throws MalformedURLException, ClassNotFoundException, InstantiationException, IllegalAccessException{
		
	/*	TaggingStrategy tagStrategy = new TaggingStrategy();
		
		tagStrategy.dynamicLoad();*/
		
		//Create the GUI of the service.
        remoteGUI = RemoteControlGUI.getInstance();
        //Start to play the GUI.
        remoteGUI.start();
        
        
        service = new Service();
        fileManager = new FileManager();
        
		// register directory and process its events
        Path dir = Paths.get("C:\\cs\\projectDic");
        osListener=new OSListener(dir);
        
        Thread listenerThread = new Thread(osListener);
        listenerThread.start();
        
        //Add the service and the fileManager to be an observers of osListener.
        osListener.addObserver(service);
        osListener.addObserver(fileManager);
        
	}
}
